from django.test import TestCase
from mystudents.models import student
import pymysql
from django.db import DatabaseError
# Create your tests here.
if __name__ == '__main__':
    conn = pymysql.connect(host='127.0.0.1', user='root', password='123456', port=3306, database='students', charset='utf8')
    cur = conn.cursor()
    sql = 'insert into mystudents_student values("S200901001","张大成",20,"男","计算机系")'
    count = cur.execute(sql)
    print('行数%d' % count)
    cur.close()
    conn.close()
    # stu = student(sno='S200901001', sname='张大成', ssex='男', sage=20, sdept='计算机系')
    # stu.sava()
